With improvement of LED light efficiency, the use of an LED light source instead of a fluorescent lamp has become a development trend. The fluorescent lamp generally requires an inductive ballast or an electronic ballast for power supply; the inductive ballast outputs a power-frequency signal, for example, a voltage and current signal at 50/60 Hz, and the electronic ballast outputs a high-frequency signal, which is generally greater than 20 kHz. In alternative applications, an LED driver also needs to be compatible with the inductive ballast or the electronic ballast, and even needs to be compatible with both the inductive ballast and the electronic ballast.